package fxmltest;

import fxmltest.control.feature.FeatureTree;
import fxmltest.control.layer.LayerOpacityTable;
import fxmltest.control.level.ContentTree;
import fxmltest.control.property.PropertyPane;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.StackPane;


public class FXMLTestController
    implements Initializable {

    @FXML //  fx:id="contentScrollPane"
    private ScrollPane contentScrollPane; // Value injected by FXMLLoader

    @FXML //  fx:id="dataTabPane"
    private TabPane dataTabPane; // Value injected by FXMLLoader

    @FXML //  fx:id="featureScrollPane"
    private ScrollPane featureScrollPane; // Value injected by FXMLLoader

    @FXML //  fx:id="mapPane"
    private StackPane mapPane; // Value injected by FXMLLoader

    @FXML //  fx:id="propertyTabPane"
    private TabPane propertyTabPane; // Value injected by FXMLLoader


    @Override // This method is called by the FXMLLoader when initialization is complete
    public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
        assert contentScrollPane != null : "fx:id=\"contentScrollPane\" was not injected: check your FXML file 'FXMLTest.fxml'.";
        assert dataTabPane != null : "fx:id=\"dataTabPane\" was not injected: check your FXML file 'FXMLTest.fxml'.";
        assert featureScrollPane != null : "fx:id=\"featureScrollPane\" was not injected: check your FXML file 'FXMLTest.fxml'.";
        assert mapPane != null : "fx:id=\"mapPane\" was not injected: check your FXML file 'FXMLTest.fxml'.";
        assert propertyTabPane != null : "fx:id=\"propertyTabPane\" was not injected: check your FXML file 'FXMLTest.fxml'.";

        // initialize your logic here: all @FXML variables will have been injected
		
		//add conent pane
		ContentTree contentTree = new ContentTree();
//		contentTree.init();
		contentScrollPane.setContent(contentTree);
		contentScrollPane.setFitToWidth(true);
		contentScrollPane.setFitToHeight(true);
		
		//add conent pane
		FeatureTree featureTree = new FeatureTree();
		featureTree.init();
		featureScrollPane.setContent(featureTree);
		featureScrollPane.setFitToWidth(true);
		featureScrollPane.setFitToHeight(true);
		
		//add a property tab
		PropertyPane propertyPane = new PropertyPane();
		Tab tab = new Tab();
		tab.setContent(propertyPane);
		tab.setText("Test Tab");
		propertyTabPane.getTabs().add(tab);
		
		//add layer tab
		LayerOpacityTable layerOpacityTable = new LayerOpacityTable();
		layerOpacityTable.init();
		ScrollPane scrollPane = new ScrollPane();
		scrollPane.setFitToHeight(true);
		scrollPane.setFitToWidth(true);
		scrollPane.setContent(layerOpacityTable);
		tab = new Tab();
		tab.setContent(scrollPane);
		tab.setText("Map Layers");
		dataTabPane.getTabs().add(tab);
		

    }

}

